#include <cstdio>
#include <cstring>

const int MAX = 1000;
struct node {
	char name[20];
	char password[20];
	bool flag;  // true: 经过修改
}T[MAX+10];

void needChange(node& t, int &cnt) {
	int len = strlen(t.password);
	for (int i = 0; i < len; i++) {
		if (t.password[i] == '1') {
			t.password[i] = '@';
			t.flag = true;
		} else if (t.password[i] == '0') {
			t.password[i] = '%';
			t.flag = true;
		} else if (t.password[i] == 'l') {
			t.password[i] = 'L';
			t.flag = true;
		} else if (t.password[i] == 'O') {
			t.password[i] = 'o';
			t.flag = true;
		}
	}
	if (t.flag) {
		cnt++;
	}
}

int main() {
	int N;
	int count = 0;

	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%s %s", T[i].name, T[i].password);
		T[i].flag = false;
	}
    for (int i = 0; i < N; i++) {
        needChange(T[i], count);
    }

	if (count == 0) {
		if (N == 1) {
			printf("There is %d account and no account is modified", N);
		} else {
			printf("There are %d accounts and no account is modified", N);
		}
	} else {
		printf("%d\n", count);
		for (int i = 0; i < N; i++) {
			if (T[i].flag) {
				printf("%s %s\n", T[i].name, T[i].password);
			}
		}
	}

	return 0;
}
